The Dreamweaver JavaScript API > Selection functions > dom.source.replaceRange()

 

dom.source.replaceRange()

Availability

Dreamweaver 4.0

Description

Replaces the range of source text between startOffset and endOffset with string. If startOffset is greater than endOffset or if either offset is not a positive integer, does nothing and returns false. If endOffset is greater than the number of characters in the file, replaces the range between startOffset and the end of the file. If both startOffset and endOffset are greater than the number of characters in the file, inserts the text at the end of the file.

Arguments

startOffset, endOffset, string

startOffset is the offset indicating the beginning of the block to replace.
endOffset is the offset indicating the end of the block to replace.
string is the string to insert.

Returns

true if successful, false if not.